package com.neuedu.action.web;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.neuedu.model.Device;
import com.neuedu.model.Laws;
import com.neuedu.model.News;
import com.neuedu.service.DeviceService;
import com.neuedu.service.LawsService;
import com.neuedu.service.NewsService;

@Controller
@RequestMapping("/device")
public class DeviceWebAction {

	@Autowired
	private DeviceService deviceService;
	
	@RequestMapping(value = "/findAll")
	public String findAll(HttpServletRequest request, HttpServletResponse response) throws Exception {

		Map<String, Object> map2 = new HashMap<String, Object>();
		Map<String, Object> pageMap2 = new HashMap<String, Object>();
		pageMap2.put("startPage", 0);
		pageMap2.put("endPage", 4);
		
		List<Device> d = deviceService.findAll(pageMap2);
		request.setAttribute("deviceList", d);
		
		
		return "udevice";
	}
}
